package com.sword.cases.factoryMethod.simpleFactory;

/**
 * Created by SwordLiu on 2017-05-09.
 */
public class SenderFactory
{
    public Sender produce(String type)
    {
        if("mail".equals(type)){
            return new MailSender();
        }else if("sms".equals(type)){
            return new SmsSender();
        }else {
            System.out.println("Please enter the correct type.");
            return null;
        }
    }
}
